Component({
    options: {
        multipleSlots: !0
    },
    properties: {
        coursePriceData: {
            type: Number
        },
        voucherRealAmount: {
            type: Number,
            value: ""
        },
        cancelText: {
            type: String,
            value: "取消"
        },
        confirmText: {
            type: String,
            value: "确定"
        }
    },
    data: {
        problem_msg: "",
        issueArr: [ "学生没有出席该课时", "教师没有出席该课时", "事先达成一致", "其他" ],
        solutionArr: [ "重新安排该课时", "退换课时信用点数给学生" ],
        option1: {
            v: "S",
            t: "重新安排该课时"
        },
        option3: {
            v: "TS",
            t: "退还课时信用点数给学生"
        },
        option4: {
            v: "TT",
            t: "将课时信用点数转给教师"
        }
    },
    ready: function(t) {
        if (!this.selectComponent) throw new Error("小程序sdk暂不支持节点操作selectComponent");
        this.baseModal = this.selectComponent("#baseModal");
    },
    methods: {
        bindIssueChange: function(t) {
            var e = Number(t.detail.value), a = {
                v: "C",
                t: "退还课时信用点数给学生 （$0.10 - " + this.data.coursePriceData + " USD信用点数）"
            };
            if (this.data.voucherRealAmount) a = {
                v: "TS",
                t: "申请全额退款给学生"
            };
            switch (e) {
              case 0:
                this.data.solutionArr = [ this.data.option1, this.data.option4, a ];
                break;

              case 1:
                this.data.solutionArr = [ this.data.option1, this.data.option3 ];
                break;

              case 2:
              case 3:
                this.data.solutionArr = [ this.data.option1, this.data.option4, a ];
            }
            this.setData({
                issueIndex: t.detail.value,
                solutionArr: this.data.solutionArr,
                solutionIndex: ""
            });
        },
        bindSolutionChange: function(t) {
            var e = Number(t.detail.value), a = this.data.solutionArr[e].v, i = "C" === a;
            this.setData({
                solutionIndex: e,
                nextStatus: a,
                showMoney: i
            });
        },
        show: function() {
            this.triggerEvent("scrollEvent", {
                noScroll: !0
            }), this.baseModal.showModal();
        },
        hide: function() {
            this.triggerEvent("scrollEvent", {
                noScroll: !1
            }), this.baseModal.hideModal();
        },
        _cancelModal: function() {
            this.hide(), this.triggerEvent("cancelEvent");
        },
        bindTextAreaBlur: function(t) {
            void 0 !== t.detail.value && this.setData({
                problem_msg: t.detail.value
            });
        },
        _confirmModal: function(t) {
            if (this.problem_msg) this.setData({
                showReasonError: !0
            }); else {
                var e = this.data.refund_itc_usd, a = this.data.nextStatus;
                if ("S" == a && (e = -1), "TT" == a && (e = 0), "TS" == a && (e = 100 * this.data.coursePriceData), 
                "C" == a && (e *= 100), void 0 !== e) var i = parseInt(e).toFixed();
                a = "S" === a ? "S" : "CE";
                var s = Number(this.data.issueIndex) + 1, o = 4 === s ? 100 : s;
                this.triggerEvent("confirmEvent", {
                    problem_msg: this.data.problem_msg,
                    problem_reason: o,
                    next_status: a,
                    refund_itc_usd: i
                }), this.hide();
            }
        },
        bindMoney: function(t) {
            var e = t.detail.value;
            e < .1 || e > this.data.coursePriceData || isNaN(e) ? this.setData({
                showInputError: !0
            }) : this.setData({
                showInputError: !1
            }), this.setData({
                refund_itc_usd: e
            });
        }
    }
});